<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>dil.Unicode</title>
  <link href="./css/style.css" rel="stylesheet" type="text/css"/>
  <!-- <link href="./img/icon.png" rel="icon" type="image/png"/> -->
  <script type="text/javascript" src="./js/jquery.js"></script>
  <script type="text/javascript" src="./js/modules.js"></script>
  <script type="text/javascript" src="./js/quicksearch.js"></script>
  <script type="text/javascript" src="./js/navigation.js"></script>
  <!--<script type="text/javascript" src="./js/jquery.treeview.js"></script>-->
  <script type="text/javascript">
    var g_moduleFQN = "dil.Unicode";
  </script>
  
</head>
<body>
<div id="content">
  <h1><a href="./htmlsrc/dil.Unicode.html" class="symbol">dil.Unicode</a></h1>
  
<p class="sec_header">Author:</p>Aziz Köksal
<p class="sec_header">License:</p>GPL3
 <p><b>Maturity:</b> very high.</p>
<dl>
<dt class="decl">dchar <a class="symbol _variable" name="REPLACEMENT_CHAR" href="./htmlsrc/dil.Unicode.html#L9" kind="variable" beg="9" end="9">REPLACEMENT_CHAR</a>; <span class="attrs">[<span class="stc">const</span>]</span> <a title="Permalink to this symbol" href="#REPLACEMENT_CHAR" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Unicode.html#L9">#</a></dt>
<dt class="decl">char[3] <a class="symbol _variable" name="REPLACEMENT_STR" href="./htmlsrc/dil.Unicode.html#L10" kind="variable" beg="10" end="10">REPLACEMENT_STR</a>; <span class="attrs">[<span class="stc">const</span>]</span> <a title="Permalink to this symbol" href="#REPLACEMENT_STR" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Unicode.html#L10">#</a></dt>
<dd class="ddef">
<div class="summary">U+FFFD = �. Used to replace invalid Unicode characters.</div></dd>
<dt class="decl">dchar <a class="symbol _variable" name="ERROR_CHAR" href="./htmlsrc/dil.Unicode.html#L12" kind="variable" beg="12" end="12">ERROR_CHAR</a>; <span class="attrs">[<span class="stc">const</span>]</span> <a title="Permalink to this symbol" href="#ERROR_CHAR" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Unicode.html#L12">#</a></dt>
<dd class="ddef">
<div class="summary">Invalid character, returned on errors.</div></dd>
<dt class="decl">bool <a class="symbol _function" name="isValidChar" href="./htmlsrc/dil.Unicode.html#L16" kind="function" beg="16" end="19">isValidChar</a><span class="params">(dchar <em>d</em>)</span>; <a title="Permalink to this symbol" href="#isValidChar" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Unicode.html#L16">#</a></dt>
<dd class="ddef">
<p class="sec_header">Returns:</p>true if this character is not a surrogate
 code point and not higher than 0x10FFFF.</dd>
<dt class="decl">bool <a class="symbol _function" name="isNoncharacter" href="./htmlsrc/dil.Unicode.html#L24" kind="function" beg="24" end="28">isNoncharacter</a><span class="params">(dchar <em>d</em>)</span>; <a title="Permalink to this symbol" href="#isNoncharacter" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Unicode.html#L24">#</a></dt>
<dd class="ddef">
<div class="summary">There are a total of 66 noncharacters.</div>
<p class="sec_header">Returns:</p>true if this is one of them.
<p class="sec_header">See Also:</p>Chapter 16.7 Noncharacters in Unicode 5.0</dd>
<dt class="decl">bool <a class="symbol _function" name="isTrailByte" href="./htmlsrc/dil.Unicode.html#L31" kind="function" beg="31" end="34">isTrailByte</a><span class="params">(ubyte <em>b</em>)</span>; <a title="Permalink to this symbol" href="#isTrailByte" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Unicode.html#L31">#</a></dt>
<dd class="ddef">
<p class="sec_header">Returns:</p>true if this is a trail byte of a UTF-8 sequence.</dd>
<dt class="decl">bool <a class="symbol _function" name="isLeadByte" href="./htmlsrc/dil.Unicode.html#L37" kind="function" beg="37" end="40">isLeadByte</a><span class="params">(ubyte <em>b</em>)</span>; <a title="Permalink to this symbol" href="#isLeadByte" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Unicode.html#L37">#</a></dt>
<dd class="ddef">
<p class="sec_header">Returns:</p>true if this is a lead byte of a UTF-8 sequence.</dd>
<dt class="decl">bool <a class="symbol _function" name="isUnicodeAlpha" href="./htmlsrc/dil.Unicode.html#L45" kind="function" beg="45" end="57">isUnicodeAlpha</a><span class="params">(ref char* <em>ref_p</em>, char* <em>end</em>)</span>; <a title="Permalink to this symbol" href="#isUnicodeAlpha" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Unicode.html#L45">#</a></dt>
<dd class="ddef">
<div class="summary">Advances ref_p only if this is a valid Unicode alpha character.</div>
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>ref_p</em></td><td>set to the last trail byte of the valid UTF-8 sequence.</td></tr></table></dd>
<dt class="decl">dchar <a class="symbol _function" name="decode" href="./htmlsrc/dil.Unicode.html#L63" kind="function" beg="63" end="74">decode</a><span class="params">(char[] <em>str</em>, ref size_t <em>index</em>)</span>; <a title="Permalink to this symbol" href="#decode" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Unicode.html#L63">#</a></dt>
<dd class="ddef">
<div class="summary">Decodes a character from str at index.</div>
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>index</em></td><td>set to one past the ASCII char or one past the last trail byte
           of the valid UTF-8 sequence.</td></tr></table></dd>
<dt class="decl">dchar <a class="symbol _function" name="decode:2" href="./htmlsrc/dil.Unicode.html#L80" kind="function" beg="80" end="151">decode</a><span class="params">(ref char* <em>ref_p</em>, char* <em>end</em>)</span>; <a title="Permalink to this symbol" href="#decode:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Unicode.html#L80">#</a></dt>
<dd class="ddef">
<div class="summary">Decodes a character starting at ref_p.</div>
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>ref_p</em></td><td>set to one past the ASCII char or one past the last trail byte
           of the valid UTF-8 sequence.</td></tr></table></dd>
<dt class="decl">void <a class="symbol _function" name="encode" href="./htmlsrc/dil.Unicode.html#L154" kind="function" beg="154" end="205">encode</a><span class="params">(ref char[] <em>str</em>, dchar <em>c</em>)</span>; <a title="Permalink to this symbol" href="#encode" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Unicode.html#L154">#</a></dt>
<dd class="ddef">
<div class="summary">Encodes c and appends it to str.</div></dd>
<dt class="decl">void <a class="symbol _function" name="encode:2" href="./htmlsrc/dil.Unicode.html#L208" kind="function" beg="208" end="224">encode</a><span class="params">(ref wchar[] <em>str</em>, dchar <em>c</em>)</span>; <a title="Permalink to this symbol" href="#encode:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Unicode.html#L208">#</a></dt>
<dd class="ddef">
<div class="summary">Encodes c and appends it to str.</div></dd>
<dt class="decl">dchar <a class="symbol _function" name="decode:3" href="./htmlsrc/dil.Unicode.html#L231" kind="function" beg="231" end="254">decode</a><span class="params">(wchar[] <em>str</em>, ref size_t <em>index</em>)</span>; <a title="Permalink to this symbol" href="#decode:3" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Unicode.html#L231">#</a></dt>
<dd class="ddef">
<div class="summary">Decodes a character from a UTF-16 sequence.</div>
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>str</em></td><td>the UTF-16 sequence.</td></tr>
<tr><td><em>index</em></td><td>where to start from.</td></tr></table>
<p class="sec_header">Returns:</p>ERROR_CHAR in case of an error in the sequence.</dd>
<dt class="decl">dchar <a class="symbol _function" name="decode:4" href="./htmlsrc/dil.Unicode.html#L261" kind="function" beg="261" end="282">decode</a><span class="params">(ref wchar* <em>p</em>, wchar* <em>end</em>)</span>; <a title="Permalink to this symbol" href="#decode:4" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Unicode.html#L261">#</a></dt>
<dd class="ddef">
<div class="summary">Decodes a character from a UTF-16 sequence.</div>
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>p</em></td><td>start of the UTF-16 sequence.</td></tr>
<tr><td><em>end</em></td><td>one past the end of the sequence.</td></tr></table>
<p class="sec_header">Returns:</p>ERROR_CHAR in case of an error in the sequence.</dd>
<dt class="decl">dchar <a class="symbol _function" name="decode:5" href="./htmlsrc/dil.Unicode.html#L288" kind="function" beg="288" end="309">decode</a><span class="params">(ref wchar* <em>p</em>)</span>; <a title="Permalink to this symbol" href="#decode:5" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Unicode.html#L288">#</a></dt>
<dd class="ddef">
<div class="summary">Decodes a character from a zero-terminated UTF-16 string.</div>
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>p</em></td><td>start of the UTF-16 sequence.</td></tr></table>
<p class="sec_header">Returns:</p>ERROR_CHAR in case of an error in the sequence.</dd>
<dt class="decl">wchar[] <a class="symbol _function" name="toUTF16" href="./htmlsrc/dil.Unicode.html#L312" kind="function" beg="312" end="328">toUTF16</a><span class="params">(char[] <em>str</em>)</span>; <a title="Permalink to this symbol" href="#toUTF16" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Unicode.html#L312">#</a></dt>
<dd class="ddef">
<div class="summary">Converts a UTF-8 string to a UTF-16 string.</div></dd>
<dt class="decl">dchar[] <a class="symbol _function" name="toUTF32" href="./htmlsrc/dil.Unicode.html#L331" kind="function" beg="331" end="347">toUTF32</a><span class="params">(char[] <em>str</em>)</span>; <a title="Permalink to this symbol" href="#toUTF32" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/dil.Unicode.html#L331">#</a></dt>
<dd class="ddef">
<div class="summary">Converts a UTF-8 string to a UTF-32 string.</div></dd></dl>
</div>
<div id="footer">
  <p>Copyright © 2007-2008, Aziz Köksal. All rights reserved.</p>
  <p>Page generated by <a href="http://code.google.com/p/dil">dil</a> on Fri Dec 26 04:12:54 2008. Rendered by <a href="http://code.google.com/p/dil/wiki/Kandil">kandil</a>.</p>
</div>
</body>
</html>